import axios from 'axios'
import qs from 'qs'// 把对象转成字符串
const baseURL = process.env.NODE_ENV === 'development' ? '/api' : 'http://hyyy.vaiwan.com'
axios.defaults.baseURL = baseURL// 后端接口的主机和端口号
axios.defaults.withCredentials = true// 跨域的时候，是否携带cookie
axios.defaults.transformRequest = (data = {}) => qs.stringify(data)
axios.interceptors.response.use(result => result.data)
export default axios
